<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" >
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" th:href="@{/admin/bootstrap4/css/bootstrap.css}">
    <script th:src="@{/admin/bootstrap4/js/jquery-3.3.1.min.js}"></script>
    <script th:src="@{/admin/bootstrap4/js/bootstrap.js}"></script>

</head>
<style>
    .my{
        width:80%;
        height: 170px;
        margin-left:10%;
        display: flex;
        flex-wrap: wrap;
        justify-content: start;
        /*align-content: flex-start;*/
    }
    .mycard{
        width: 70rem;
        height: 10rem;
        margin-left: 10px;
    }
</style>
<body>
<br>
<div class="my" th:each="article:${articleList}">
    <div class="card mycard">
        <div class="card-body">
            <h5 class="card-title" th:text="${article.articleTitle}"></h5>
            <span class="badge badge-light">发布时间：[[${#dates.format(article.articleTime,'yyyy-MM-dd hh:mm')}]]</span>
            <p class="card-text" th:text="${#strings.abbreviate(article.articleContent,75)}"></p>
            <a type="button" class="btn btn-outline-success btn-sm" th:href="@{/admin/findArticleDetailById(articleId=${article.articleId},currentIndex=${currentIndex},flag=true)}">查看</a>
            <a type="button" class="btn btn-outline-danger btn-sm" th:href="@{/admin/delArticle(articleid=${article.articleId},currentIndex=${currentIndex})}">删除</a>
        </div>
    </div>
</div>
    <nav aria-label="Page navigation example" style="margin-left: 10%">
        <ul class="pagination">
            <li class="page-item">
                <a class="page-link" th:href="@{/admin/articleList(currentIndex=${currentIndex -1})}" aria-label="Previous">
                    <span aria-hidden="true">&laquo;</span>
                </a>
            </li>
            <li class="page-item"><a class="page-link" href="#">第[[${currentIndex}]]页</a></li>
            <li class="page-item"><a class="page-link" href="#">共[[${page.getPages()}]]页</a></li>
            <li class="page-item">
                <a class="page-link" th:href="@{/admin/articleList(currentIndex=${currentIndex+1})}" aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                </a>
            </li>
        </ul>
    </nav>

</body>
</html>